Xbasic
INET::SFTPListDirectory Method
Syntax
.ListDirectory as L (BYREF Listing as C, SFTPPath as C [, GetDetails as L = .t.])
Arguments
- ListingCharacter
The contents of the directory listing returned.
- SFTPPathCharacter
The path to the directory on the server that you would like a directory of.
- GetDetailsLogical
This value defaults to .t. If the value is set to .t., a detailed directory listing will be returned. If you set the value to .f., only file and director names will be included and the system directories "." and ".." will be removed from the list.
Returns
- resultLogical
Returns .t. if the operation succeed. Otherwise, returns .f.. If an error occurred, the INET::SFTP CallResult property will contain more information.
Description
List the contents of a server directory.
Example
dim ftp as INET::SFTP sftp.UserName = "Fred" sftp.Password = "Secret" sftp.ServerHost = "ftp.myserver.com" dim Listing as C if sftp.ListDirectory(Listing, "/downloads") <> .t. ' error msg = sftp.callResult.error ... end if